// 利用对象的键值对 不能相同来去重
let arr = [1, 1, 2, 3, 3, 7, 5, 4, 1]
let obj = {}
let filterArr = arr => {
  let length = arr.length
  for (let index = 0; index < length; index++) {
    obj[arr[index]] = index
  }
  return Object.keys(obj)
}

console.log(filterArr(arr))